package com.shyroke.service.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shyroke.entity.readRecord;
import com.shyroke.mapper.readRecordMapper;
import com.shyroke.service.ReadRecordServiceI;

@Service
public class ReadRecordServiceImp implements ReadRecordServiceI {

	@Autowired
	private readRecordMapper readRecordMapper;
	
	@Override
	public void insert(Integer xiaoshuoId, Integer id,Integer userId) {
		
		readRecord record = new readRecord();
		record.setUserid(userId);
		record.setMaoid(id);
		record.setXiaoshuoid(xiaoshuoId);
		readRecordMapper.insert(record);
		
	}

	@Override
	public void deleteByOld(Integer userId, Integer xiaoshuoId) {
		readRecordMapper.deleteByOld(userId,xiaoshuoId);
		
	}

	@Override
	public readRecord selectByXiaoshuoIdAndUserId(Integer xiaoshuoId, Integer id) {
		
		readRecord readRecord = readRecordMapper.selectByXiaoshuoIdAndUserId(xiaoshuoId,id);
		
		
		return readRecord;
	}



}
